package com.lagou.client;

import com.lagou.service.UserService;
import com.lagou.service.com.lagou.zookeeper.ServiceDiscovery;
import com.lagou.service.com.lagou.zookeeper.ZooKeeperServiceDiscovery;

public class ClientBootStrap {

    public static  final String providerName="UserService#sayHello#";

    public static void main(String[] args) throws InterruptedException {

        ServiceDiscovery serviceDiscovery = new ZooKeeperServiceDiscovery("127.0.0.1");
        RpcConsumer rpcConsumer = new RpcConsumer(serviceDiscovery);
        UserService proxy = (UserService) rpcConsumer.createProxy(UserService.class, providerName);

        while (true){
            Thread.sleep(5000);
            System.out.println(proxy.sayHello("are you ok?"));
        }


    }




}
